Micron Document
Fox's Git Mirrors

Commit 6c9e0f1fb4f9199d833c369934dd1fc84af4341d


Parents : b075bdd
Author : Mark Qvist <mark@unsigned.io>
Date : 2020-10-22T15:59:10+02:00

GPS init sequence fix

Changes

3 files changed, 6 insertions(+), 3 deletions(-)


Diff

diff --git a/hardware/Bluetooth.h b/hardware/Bluetooth.h
index 05841e2..a84c467 100644
--- a/hardware/Bluetooth.h
+++ b/hardware/Bluetooth.h
@@ -8,7 +8,7 @@
#include <stdio.h>
#include "device.h"
#include "util/time.h"
-#include "hardware/serial.h"
+#include "hardware/Serial.h"
void bluetooth_init(void);
bool bluetooth_enabled(void);

diff --git a/hardware/GPS.c b/hardware/GPS.c
index 49f7d51..e85953c 100644
--- a/hardware/GPS.c
+++ b/hardware/GPS.c
@@ -39,6 +39,7 @@ void gps_init(Serial *ser) {
gps_speed_kmh = 0;
gps_bearing = 0;
+ gps_fix = false;
gps_time_set = false;
if (gps_detect()) {
@@ -46,6 +47,8 @@ void gps_init(Serial *ser) {
GPS_DDR |= _BV(GPS_EN_PIN);
if (config_gps_mode == CONFIG_GPS_AUTODETECT || config_gps_mode == CONFIG_GPS_REQUIRED) {
+ gps_powerup();
+
serial_setbaudrate_9600(1);
delay_ms(100);
@@ -59,7 +62,6 @@ void gps_init(Serial *ser) {
gps_send_command(PMTK_SET_NMEA_OUTPUT_RMCGGA);
gps_power = true;
- gps_powerup();
} else {
gps_power = false;
gps_powerdown();
@@ -71,6 +73,7 @@ void gps_init(Serial *ser) {
}
}
+
void gps_update_rtc(void) {
struct tm now;

diff --git a/hardware/GPS.h b/hardware/GPS.h
index 831d760..6886c93 100644
--- a/hardware/GPS.h
+++ b/hardware/GPS.h
@@ -8,7 +8,7 @@
#include <stdio.h>
#include "device.h"
#include "util/time.h"
-#include "hardware/serial.h"
+#include "hardware/Serial.h"
#define NMEA_MAX_LENGTH 128

Served by rngit 1.5.0 - Generated in 0.05s